package com.jhonatan.sitcom.util;

public class Capitalize {
	public static String toTitleCase(String string) {
		char[] chars = string.toLowerCase().toCharArray();
		  boolean found = false;
		  for (int i = 0; i < chars.length; i++) {
			  if(Character.isLetter(chars[i])) { 
				  if(!found) {
					  chars[i] = Character.toUpperCase(chars[i]);
					} 	
				 found = true; 			
				} else {
				 found = false;
				}
		  }
		  return String.valueOf(chars);
	}

}
